﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using RealEstateBrowser.Helpers;

namespace RealEstateBrowser.ViewModels
{
    public class AdvancedSearchViewModel : ViewModelBase
    {
        private string id;
        private bool? active;
        private OfferTypeViewModel offerType;
        private EstateTypeViewModel estateType;
        private DateTime? date;
        private TownViewModel town;
        private DistrictViewModel district;
        private string priceString;
        private string sizeString;
        private ObservableCollection<ExtraViewModel> extras;

        public AdvancedSearchViewModel()
        {
            this.id = null;
            this.active = null;
            this.offerType = null;
            this.estateType = null;
            this.date = null;
            this.town = null;
            this.district = null;
            this.priceString = null;
            this.sizeString = null;
            this.extras = new ObservableCollection<ExtraViewModel>(Skochubra.GetExtras());
        }
        public string Id
        {
            get
            {
                return id;
            }
            set
            {
                if (id != value)
                {
                    id = value;
                    OnPropertyChanged("Id");
                }
            }
        }

        public bool? Active
        {
            get
            {
                return active;
            }
            set
            {
                active = value;
                OnPropertyChanged("Active");
            }
        }

        public OfferTypeViewModel OfferType
        {
            get
            {
                return offerType;
            }
            set
            {
                offerType = value;
                OnPropertyChanged("OfferType");
            }
        }

        public EstateTypeViewModel EstateType
        {
            get
            {
                return estateType;
            }
            set
            {
                estateType = value;
                OnPropertyChanged("EstateType");
            }
        }

        public DateTime? Date
        {
            get
            {
                return date;
            }
            set
            {
                date = value;
                OnPropertyChanged("Date");
            }
        }

        public TownViewModel Town
        {
            get
            {
                return town;
            }
            set
            {
                town = value;
                OnPropertyChanged("Town");
            }
        }

        public DistrictViewModel District
        {
            get
            {
                return district;
            }
            set
            {
                district = value;
                OnPropertyChanged("District");
            }
        }

        public string Price
        {
            get
            {
                return priceString;
            }
            set
            {
                priceString = value;
                OnPropertyChanged("Price");
            }
        }

        public string Size
        {
            get
            {
                return sizeString;
            }
            set
            {
                sizeString = value;
                OnPropertyChanged("Size");
            }
        }

        public ObservableCollection<ExtraViewModel> Extras
        {
            get
            {
                return extras;
            }
            set
            {
                extras = value;
                OnPropertyChanged("Extras");
            }
        }
    }
}
